<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<title>Blue Moon - Responsive Admin Dashboard</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
	content="Blue Moon - Responsive Admin Dashboard" />
<meta name="keywords"
	content="Notifications, Admin, Dashboard, Bootstrap3, Sass, transform, CSS3, HTML5, Web design, UI Design, Responsive Dashboard, Responsive Admin, Admin Theme, Best Admin UI, Bootstrap Theme, Wrapbootstrap, Bootstrap, bootstrap.gallery" />
<meta name="author" content="Bootstrap Gallery" />
<link rel="shortcut icon" href="img/favicon.ico">

<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/wysi/bootstrap-wysihtml5.css" rel="stylesheet">

<link href="css/new.css" rel="stylesheet">
<link href="css/new2.css">



<link href="css/jquery.treetable.theme.default.css" rel="stylesheet"
	type="text/css" />
<link href="css/jquery.treetable.css" rel="stylesheet" type="text/css" />
<!-- Important. For Theming change primary-color variable in main.css  -->

<!-- Color Picker -->
<link rel="stylesheet" href="css/color-picker/jquery.minicolors.css">

<link href="fonts/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/new2.css">
<!--CSACASDAAAAAAAAAAA-->
<script src="layer/jquery.min.js"></script>
<script src="layer/layer.js"></script>
<link href="layer/bootstrap.css">

<!-- HTML5 shiv and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
</head>

<body>
	<form th:action="@{/sourceGeneration}" id="sourceGeneration-form">
		<!-- Header Start -->
		<!-- 嵌入头部 -->
		<div th:include="common/header :: header"></div>
		<!-- Header End -->

		<!-- Main Container start -->
		<div class="dashboard-container">

			<div class="container">
				<!-- 嵌入顶部导航栏 -->
				<div th:replace="common/topnav :: topnav"></div>
				<!-- 顶部导航栏End -->

				<!-- 地址 -->
				<!-- 嵌入时间显示片段 -->
				<div th:replace="common/time :: time"></div>

				<!-- Dashboard Wrapper Start -->
				<div class="dashboard-wrapper">
					<!-- Row Start -->
					<div class="row">
						<div class="col-lg-12 col-md-12">

							<div class="widget">
								<div class="widget-header" id="sda">
									<div>
										<strong>房间资料</strong> <a id="dynamic-tables"></a>
									</div>
								</div>
								<div class="widget-body">
									<div id="dt_example" class="example_alt_pagination">
										<div class="row">
											<div class="col-xs-4">
												项目 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select
													style="width: 60%; height: 30px" name="projectId">
													<option value="0">全部</option>
													<!-- 循环 -->
													<th:block th:each="project : ${projects}">
														<!-- 如果相等，默认选中 -->
														<th:block th:if="${projectId} eq ${project.projectId}">
															<option th:value="${project.projectId}"
																th:text="${project.projectName}" selected="selected">b</option>
														</th:block>
														<!-- 正常循环下拉列表 -->
														<th:block th:if="${projectId} != ${project.projectId}">
															<option th:value="${project.projectId}"
																th:text="${project.projectName}">b</option>
														</th:block>
													</th:block>
												</select>
											</div>
											<div class="col-xs-4">
												关键字 &nbsp; <input type="text"
													style="width: 60%; height: 30px" name="list"
													th:value="${list}">
											</div>
											<div class="col-xs-2">
												<button type="submit" class="btn btn-primary"
													style="height: 30px; width: 60%; padding: 0px">查询</button>
											</div>

											<div class="col-xs-2">
												<button type="button" class="btn btn-primary"
													style="height: 30px; width: 60%; padding: 0px">查询全部</button>
											</div>
										</div>
									</div>
								</div>
							</div>

						</div>
					</div>

					<div class="row">
						<div class="col-lg-12 col-md-12">
							<div class="widget">
								<div class="widget-header">
									<div class="title">
										房间列表<a id=""></a>
									</div>
									<div style="float: right">
										<span style="font-weight: bold"><a id="parentIframe">调整</a>
										</span>
									</div>
								</div>
								<div class="widget-body" style="padding: 0px">
									<div class="example_alt_pagination">
										<table width=""
											class="table table-condensed table-striped table-hover table-bordered pull-left"
											id="data-table">
											<thead>
												<tr>
													<th style="width: 3%; height: 8%"><input
														type="checkbox" style="height: 10px" class="no-margin">序号
													</th>
													<th style="width: 14%">房间</th>
													<th style="width: 10%">户型名称</th>
													<th style="width: 10%" class="hidden-phone">房间结构</th>
													<th style="width: 5%" class="hidden-phone">建筑面积</th>
													<th style="width: 5%" class="hidden-phone">套内面积</th>
													<th style="width: 7%" class="hidden-phone">面积状态</th>
													<th style="width: 7%" class="hidden-phone">销控状态</th>
													<th style="width: 7%" class="hidden-phone">租售状态</th>
													<th style="width: 7%" class="hidden-phone">建筑单价</th>
													<th style="width: 7%" class="hidden-phone">套内单价</th>
													<th style="width: 7%" class="hidden-phone">标准总价</th>
													<th style="width: 7%" class="hidden-phone">户型点评</th>
												</tr>
											</thead>
											<tbody>
												<input name="span" th:value="${(page.pageNum-1)}*10"
													type="hidden" />
												<tr class="gradeX warning roomTr" th:each="room : ${rooms}">
													<td><input type="checkbox" style="height: 10px"
														class="no-margin" name="checkboxs"
														th:value="${room.roomId}" /><span class="pageSpan"></span></td>
													<td
														th:text="${room.project_name}+'-'+${room.det_abbreviation}+'-'+${room.ban_name}+'-'+${room.roomNumber}">翡翠绿州-一期-联排别墅-101</td>
													<td th:text="${room.hou_name}">31.1 %</td>
													<td class="hidden-phone" th:text="${room.roomStructure}">46.9%</td>
													<td class="hidden-phone" th:text="${room.roomCoveredArea}">21413241</td>
													<td class="hidden-phone" th:text="${room.roomInnerArea}">7865432</td>
													<td class="hidden-phone" th:text="${room.roomAreastate}">2.1
														%</td>
													<td class="hidden-phone" th:text="${room.roomSalesstatus}">2.1
														%</td>
													<td class="hidden-phone" th:text="${room.roomLeasetype}">2.1
														%</td>
													<td class="hidden-phone roomBuildingUnitPrice"
														th:text="${room.roomBuildingUnitPrice}">2.1 %</td>
													<td class="hidden-phone roomInternalUnitPrice"
														th:text="${room.roomInternalUnitPrice}">2.1 %</td>
													<td class="hidden-phone roomStandardtotalprice"
														th:text="${room.roomStandardtotalprice}">2.1 %</td>
													<td class="hidden-phone"
														th:text="${room.roomHousetypereview}">2.1 %</td>
												</tr>
												<!-- <tr class="gradeC">
												<td><input type="checkbox" style="height: 10px"
													class="no-margin">2</td>
												<td>翡翠绿州-一期-联排别墅-101</td>
												<td>31.2 %</td>
												<td class="hidden-phone">46.3 %</td>
												<td class="hidden-phone">
													<div contenteditable="true">12312312</div>
												</td>
												<td class="hidden-phone">
													<div contenteditable="true">2131222245</div>
												</td>
												<td>November</td>
												<td>November</td>
												<td>November</td>
												<td>November</td>
												<td>November</td>
												<td>November</td>
												<td>November</td>
											</tr>
											<tr class="gradeX warning">
												<td><input type="checkbox" style="height: 10px"
													class="no-margin">1</td>
												<td>翡翠绿州-一期-联排别墅-101</td>
												<td>31.1 %</td>
												<td class="hidden-phone">46.9 %</td>
												<td class="hidden-phone">
													<div contenteditable="true">213123</div>
												</td>
												<td class="hidden-phone">
													<div contenteditable="true">123123</div>
												</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
											</tr>
											<tr>
												<td><input type="checkbox" style="height: 10px"
													class="no-margin">1</td>
												<td>翡翠绿州-一期-联排别墅-101</td>
												<td>31.1 %</td>
												<td class="hidden-phone">46.9 %</td>
												<td class="hidden-phone">
													<div contenteditable="true">123</div>
												</td>
												<td class="hidden-phone">
													<div contenteditable="true">12312</div>
												</td>
												<td class="hidden-phone">asd</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
												<td class="hidden-phone">2.1 %</td>
											</tr> -->
											</tbody>
										</table>
										<div style="float: right">
											<th:block th:if="${page.hasPreviousPage == true}">
												<button type="submit" class="btn btn-default"
													th:value="${page.firstPage}" name="currentPageNo">首页</button>

												<button type="submit" class="btn btn-default"
													th:value="${page.prePage}" name="currentPageNo">上页</button>
											</th:block>
											<th:block th:if="${page.hasNextPage == true}">
												<button type="submit" class="btn btn-default"
													th:value="${page.nextPage}" name="currentPageNo">下页</button>
												<button type="submit" class="btn btn-default"
													th:value="${page.lastPage}" name="currentPageNo">末页</button>
											</th:block>
										</div>

										<div class="clearfix"></div>
									</div>
								</div>
							</div>
						</div>
					</div>

				</div>
				<footer>
					<p>© BlueMoon 2013-14</p>
				</footer>
			</div>
		</div>
	</form>

	<!-- Button trigger modal -->

	<!-- Main Container end -->

	<script src="js/wysi/wysihtml5-0.3.0.min.js"></script>
	<script src="js/jquery.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/wysi/bootstrap3-wysihtml5.js"></script>
	<script src="js/jquery.scrollUp.js"></script>


	<!-- Color Picker -->
	<script src="js/color-picker/jquery.minicolors.js"></script>

	<!-- Custom JS -->
	<script src="js/menu.js"></script>

	<script type="text/javascript">
		/* 
		 * formatMoney(s,type) 
		 * 功能：金额按千位逗号分割 
		 * 参数：s，需要格式化的金额数值. 
		 * 参数：type,判断格式化后的金额是否需要小数位. 
		 * 返回：返回格式化后的数值字符串. 
		 */
		function formatMoney(s, type) {
			if (/[^0-9\.]/.test(s))
				return "0";
			if (s == null || s == "")
				return "0";
			s = s.toString().replace(/^(\d*)$/, "$1.");
			s = (s + "00").replace(/(\d*\.\d\d)\d*/, "$1");
			s = s.replace(".", ",");
			var re = /(\d)(\d{3},)/;
			while (re.test(s))
				s = s.replace(re, "$1,$2");
			s = s.replace(/,(\d\d)$/, ".$1");
			if (type == 0) {// 不带小数位(默认是有小数位)  
				var a = s.split(".");
				if (a[1] == "00") {
					s = a[0];
				}
			}
			return s;
		}
		//ScrollUp
		$(function() {
			$(".roomTr").each(function() {
				$(this).find(".roomStandardtotalprice").text(formatMoney($(this).find(".roomStandardtotalprice").text()));//标准总价
				$(this).find(".roomInternalUnitPrice").text(formatMoney($(this).find(".roomInternalUnitPrice").text()));//套内单价
				$(this).find(".roomBuildingUnitPrice").text(formatMoney($(this).find(".roomBuildingUnitPrice").text()));//建筑单价
			});

			//循环序号列
			var span = $("input[name='span']").val();
			$(".pageSpan").each(function() {
				$(this).text((span * 1) + 1);
				//alert(span);
				span++;
			});

			//复选框只能选中一个
			var fanxiBox = $("input:checkbox");
			fanxiBox.click(function() {
				if (this.checked || this.checked == 'checked') {
					fanxiBox.removeAttr("checked");
					//这里需注意jquery1.6以后必须用prop()方法
					//$(this).attr("checked",true);
					$(this).prop("checked", true);
				}
			});

			$.scrollUp({
				scrollName : 'scrollUp', // Element ID
				topDistance : '300', // Distance from top before showing element (px)
				topSpeed : 300, // Speed back to top (ms)
				animation : 'fade', // Fade, slide, none
				animationInSpeed : 400, // Animation in speed (ms)
				animationOutSpeed : 400, // Animation out speed (ms)
				scrollText : 'Top', // Text for element
				activeOverlay : false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
			});
		});

		//Tooltip
		$('a').tooltip('hide');

		//Popover
		$('.popover-pop').popover('hide');

		//Dropdown
		$('.dropdown-toggle').dropdown();

		//wysihtml5
		$('.textarea').wysihtml5();

		//Color Pickers
		$(document)
				.ready(
						function() {

							$('.demo')
									.each(
											function() {
												$(this)
														.minicolors(
																{
																	control : $(
																			this)
																			.attr(
																					'data-control')
																			|| 'hue',
																	defaultValue : $(
																			this)
																			.attr(
																					'data-defaultValue')
																			|| '',
																	inline : $(
																			this)
																			.attr(
																					'data-inline') === 'true',
																	letterCase : $(
																			this)
																			.attr(
																					'data-letterCase')
																			|| 'lowercase',
																	opacity : $(
																			this)
																			.attr(
																					'data-opacity'),
																	position : $(
																			this)
																			.attr(
																					'data-position')
																			|| 'bottom left',
																	change : function(
																			hex,
																			opacity) {
																		if (!hex)
																			return;
																		if (opacity)
																			hex += ', '
																					+ opacity;
																		try {
																			console
																					.log(hex);
																		} catch (e) {
																		}
																	},
																	theme : 'bootstrap'
																});

											});

						});
	</script>
	<script>
		//查询全部按钮的click事件
		$(".btn-primary").on('click', function() {
			window.location.href = "/sourceGeneration?projectId=0&list=";
		});

		var checkbox = 1;
		$('#parentIframe').on('click', function() {
			//获取复选框的值（单个复选框）
			var checkbox = "";
			$("input[name=checkboxs]:checkbox:checked").each(function() { //由于复选框一般选中的是多个,所以可以循环输出 
				checkbox = $(this).val();
			});
			//alert(checkbox);
			if ("" != checkbox) {
				layer.open({
					type : 2,
					skin : 'layui-layer-lan',
					title : '基本信息',
					fix : false,
					shadeClose : true,
					maxmin : true,
					area : [ '1000px', '650px' ],
					content : '/getByRoomId?roomId=' + checkbox,
				});
			} else {
				alert("请选择一个房间进行调整");
			}

		});
	</script>
</body>
</html>